#include <iostream>
using namespace std;
#include<string>

int main()
{
    string str;
    getline(cin, str);
    size_t n = 0;
    string::iterator it = str.end();
    while (it != str.begin() && *(it - 1) != ' ')
    {
        it--;
        n++;
    }
    cout << n;
    return 0;
}